﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Prism.Games.GalEngine.Scripts.Data.ResourceCollection;
using Prism.Games.GalEngine.Scripts.FunctionModel;

namespace Prism.Games.GalEngine.Scripts.Data.BranchSystem
{
    [Serializable]
    public class SectionJumper : MarkedObject, IItemIncrementalMarkableHost
    {
        public SectionJumper(IItemIncrementalMarkable host)
        {
            this.Conditions = new ConditionCollection();
            this.ConditionJudgMode = BranchSystem.ConditionJudgMode.AllCorrect;
            this.Host = host;
        }

        private ConditionCollection conditions;
        public ConditionCollection Conditions
        {
            get { return this.conditions; }
            set
            {
                if (value != this.conditions)
                {
                    this.conditions = value;
                    this.OnPropertyChanged("Conditions");
                }
            }
        }

        private ConditionJudgMode conditionJudgMode;

        public ConditionJudgMode ConditionJudgMode
        {
            get { return conditionJudgMode; }
            set
            {
                if (value != this.conditionJudgMode)
                {
                    conditionJudgMode = value;
                    this.OnPropertyChanged("ConditionJudgMode");
                }
            }
        }

        private int targetSection;

        public int TargetSection
        {
            get { return targetSection; }
            set
            {
                if (value != this.targetSection)
                {
                    targetSection = value;
                    this.OnPropertyChanged("TargetSection");
                }
            }
        }

        public IItemIncrementalMarkable Host
        {
            get;
            set;
        }
    }
}
